import 'package:flutter/material.dart';
import 'package:qunaimedical/pages/favorite_list.dart';

/// 收藏界面
class FavoritePage extends StatefulWidget {
  static String routeName = '/favorite';

  @override
  _FavoritePageState createState() => _FavoritePageState();
}

class _FavoritePageState extends State<FavoritePage> {
  @override
  Widget build(BuildContext context) {
    List<Widget> tabs = [
      Container(
        child: Text('医生'),
        height: 40,
        alignment: Alignment.center,
      ),
      Container(
        child: Text('会诊'),
        height: 40,
        alignment: Alignment.center,
      ),
      Container(
        child: Text('资讯'),
        height: 40,
        alignment: Alignment.center,
      ),
      Container(
        child: Text('课程'),
        height: 40,
        alignment: Alignment.center,
      ),
    ];
    return DefaultTabController(
      length: tabs.length,
      child: Scaffold(
        appBar: AppBar(
          title: Text('我的收藏'),
          bottom: TabBar(
            indicatorColor: Colors.transparent,
            unselectedLabelStyle: TextStyle(fontSize: 16, color: Colors.grey),
            labelStyle:
                TextStyle(fontSize: 18, color: Theme.of(context).primaryColor),
            tabs: tabs,
          ),
        ),
        body: TabBarView(
          children: [
            FavoriteList(FavoriteType.doctor),
            FavoriteList(FavoriteType.record),
            FavoriteList(FavoriteType.healthInfo),
            FavoriteList(FavoriteType.course),
          ],
        ),
      ),
    );
  }
}
